package com.fish.passport.po;

import java.util.Date;

/**
 * @author ShiHui
 */
public class PassProvider {
	private Integer providerId;
	private String name;
	private String memo;
	private String processor;
	private String separate;	//是否每一个订单子子项都独立申码
	private String sendSms;//是否由供应商发送短信
	private Date createTime;
	private Date updateTime;
	private Long beginItem;
	private Long endItem;
	public String getSeparateCn(){
		  if("true".equals(this.separate)){
			  return "订单申码";
		  }else{
			  return "产品申码";
		  }
	}
	public String getSendSmsCn(){
		  if("true".equals(this.sendSms)){
			  return "供应商";
		  }else{
			  return "平台";
		  }
	}
	public Integer getProviderId() {
		return providerId;
	}

	public void setProviderId(Integer providerId) {
		this.providerId = providerId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public String getSeparate() {
		return separate;
	}

	public void setSeparate(String separate) {
		this.separate = separate;
	}

	public boolean isSeparatelyApply() {
		return "true".equalsIgnoreCase(separate);
	}
	public boolean isSendSmsByProvider(){
		return "true".equalsIgnoreCase(this.sendSms);
	}
	public int compareTo(Object arg0 ) {
		if (arg0 instanceof PassProvider) {
			PassProvider sup = (PassProvider)arg0;
			if (providerId<sup.getProviderId()) {
				return -1;
			}else if(providerId==sup.getProviderId()) {
				return 0;
			}else {
				return 1;
			}
		}
		return -1;
	}
	public boolean equals(Object obj) {
		if (obj instanceof PassProvider) {
			PassProvider sup = (PassProvider) obj;
			if (this.providerId == null) {
				return sup.getProviderId() == null;
			} else {
				return providerId.longValue() == sup.getProviderId();
			}
		} else {
			return false;
		}
	}

	@Override
	public int hashCode() {
		if (providerId != null)
			return providerId.hashCode();
		else
			return 0;
	}

	@Override
	public String toString() {
		if (providerId != null)
			return "PassProvider_" + providerId.toString();
		else
			return "PassProvider_null";
	}

	public String getSendSms() {
		return sendSms;
	}

	public void setSendSms(String sendSms) {
		this.sendSms = sendSms;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getProcessor() {
		return processor;
	}

	public void setProcessor(String processor) {
		this.processor = processor;
	}
	public Long getBeginItem() {
		return beginItem;
	}
	public void setBeginItem(Long beginItem) {
		this.beginItem = beginItem;
	}
	public Long getEndItem() {
		return endItem;
	}
	public void setEndItem(Long endItem) {
		this.endItem = endItem;
	}
	
}
